//二叉树测试

#include <iostream>
#include "binarytree.h"

using namespace std;

void print(char c)
{
    cout << c;
}

int main()
{
    //建立二叉树
    //         - 
    //    *        c
    //  a   b
    BiTree<char> T = new BiTNode<char>{
        '-',
        new BiTNode<char>{
            '*',
            new BiTNode<char>{'a', nullptr, nullptr},
            new BiTNode<char>{'b', nullptr, nullptr},
        },
        new BiTNode<char>{'c', nullptr, nullptr},
    };

    //先序遍历
    cout << "\nPreOrder:";
    PreOrder(T, print);
    //中序遍历
    cout << "\nInOrder:";
    InOrder(T, print);
    //后序遍历
    cout << "\nPostOrder:";
    PostOrder(T, print);

    return 0;
}